//index.js
//获取应用实例
var count = 0
var app = getApp()
Page({
  data: {
    motto: 'Hello World',
    userInfo: {},
    clickResult: '',
    dataTest: {
      id: 890425,
      name: "卢泰桉"
    },
    iconSize: [20, 30, 40, 50, 60, 70],
    primarySize: 'default'
  },
  //事件处理函数
  bindViewTap: function () {
    wx.navigateTo({
      url: '../detail/detail'
    })
  },
  tapName: function (e) {
    count++
    this.setData({ clickResult: '被点击' + count + '下' })
    console.log(e.currentTarget.dataset.hi.name)
  },
  onLoad: function () {
    console.log('onLoad')
    var that = this
    //调用应用实例的方法获取全局数据
    app.getUserInfo(function (userInfo) {
      //更新数据
      that.setData({
        userInfo: userInfo
      })
    })
  }
})
